import {Animation, Sprite, Stage, Event, Stat} from './LayaLib.js'
import {stage} from './LayaLib.js'
import role from './Role.js'
import * as map from './map/Map.js'

stage.alignV = Stage.ALIGN_MIDDLE
stage.alignH = Stage.ALIGN_CENTER
stage.scaleMode = Stage.SCALE_EXACTFIT
stage.screenMode = Stage.SCREEN_HORIZONTAL
stage.bgColor = '#ffffff'

Stat.show(500, 0)

stage.addChild(role)

var isOver = true
stage.on(Event.MOUSE_DOWN, this, ()=>{
    if(isOver) {
        isOver = false
        //开始游戏
        role.start()
        map.start()
    }else {
        role.skip(20, true)
    }
})

stage.on('GAME_OVER', stage, ()=> {
    isOver = true
})
